package week3;

public class BinaryRepresentation
{
	public static void main(String[] arguments)
	{
		BinaryRepresentation br = new BinaryRepresentation();
		
		System.out.println(br.getBinary(11));
	}
	
	public String getBinary(int n)
	{
		if (n == 0)
		{
			return "0";
		}
		else if (n == 1)
		{
			return "1";
		}
		else if (n > 1)
		{
			int i = n % 2 == 0 ? 0 : 1;
			
			return getBinary(n / 2) + i; // of n % 2
		}
		else
		{
			return "?";
		}
	}
}
